Skip to content

Decode form query keys consistently with values - #607

Open
OskarEichler wants to merge 2 commits into
sporkmonger:mainfrom
OskarEichler:codex/addressable-query-keys
Open

Decode form query keys consistently with values#607
OskarEichler wants to merge 2 commits into
sporkmonger:mainfrom
OskarEichler:codex/addressable-query-keys

Conversation

@OskarEichler

Copy link
Copy Markdown

Summary

Decode form-style '+' consistently in query keys and values, while leaving encoded %2B as a literal plus. Use normalized scheme comparison so HTTP/HTTPS casing does not change decoding. Other schemes retain literal plus behavior.

Reproduction

require 'addressable'
p Addressable::URI.parse('https://example.com?a+b=c+d').query_values
# Before: {a+b => c d}; after: {a b => c d}

Verification

  • Ruby 4.0.6 through rbenv; existing suite: 1,433 examples / 0 failures / 5 existing pending with pure Ruby IDNA, 1,466 examples / 0 failures / 5 existing pending with idn-ruby 0.1.5 + libidn.
  • 14 focused external assertions pass on this individual patch; the combined installed-release branch also passes all focused cases and both existing suites.
  • Comparative RuboCop Lint: 15 existing offenses before and after; no new offense (line references move). Syntax and git diff --check pass.

Compatibility and limitations

Behavior correction: unescaped '+' in HTTP(S)/relative query keys now means a space, consistent with values. Use %2B for a literal plus. Uppercase HTTP(S) now follows the same rule; mailto and FTP remain unchanged.

No dependency/version/data updates. No repository tests were added or changed: the commissioning repository explicitly prohibits new/modified tests, so reproduction checks run outside this repository. Other Ruby versions/platforms were not run locally; upstream CI may require maintainer approval. The existing normalization proposal #589 and IDNA2008 proposal #496 are separate and unchanged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant